package com.ranjiaqi.generic01;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @ClassName TestGeneric
 * @Description TODO
 * @Author hp
 * @Date 2021/6/24 9:03
 * @Version 1.0
 **/
public class TestGeneric {
    public static void main(String[] args) {
        List list = new ArrayList();
        list.add("hello");
        list.add("helloWorld");
        list.add("helloJava");
        list.add(1);
        Iterator iterator = list.iterator();
        while (iterator.hasNext()){
            String obj = (String) iterator.next();
            System.out.println(obj);
        }
    }
}
